import numpy as np
import sys
import binascii
import struct
float32_data = struct.unpack('!f', binascii.unhexlify(sys.argv[1]))[0]
float32_data = np.array([float32_data], dtype=np.float32)
float16_data = float32_data.astype(np.float16)
print(float16_data)
binary_format = struct.pack('e', float16_data)
hex_string = ''.join(f'{c:02x}' for c in binary_format)
print(hex_string)
